﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpGuiMainFrameInterface.h"
#include "OwnerPtr.h"

#include <vector>
#include <string>

namespace gcmp
{

    class IRibbonGroup;

    //Ribbon 上下文面板接口
    class GCMP_GUI_MAIN_FRAME_INTERFACE_EXPORT IRibbonContextualPage
    {
    public:
        /// 析构函数
        virtual ~IRibbonContextualPage();

        /// 创建Ribbon 上下文面板接口
        /// \return   IRibbonContextualPage
        static OwnerPtr<IRibbonContextualPage> Create();
        
        /// 添加一个Group到指定的RibbonPage中
        ///
        ///  并将该Page设置为当前page, 且设置为上下文风格， 
        ///
        /// \param  pageId RibbonPage的Id, 唯一标识
        /// \param  pGroup 待添加的Group对象
        /// \param  contextualPageCaption RibbonPage上下文标题
        /// \return bool true-添加成功，false-添加失败
        virtual bool AddGroup(const std::wstring& pageId, OwnerPtr<IRibbonGroup> pGroup, const std::wstring& contextualPageCaption) = 0;

        /// 添加多个Group到指定的RibbonPage中
        ///
        ///  并将该Page设置为当前page, 且设置为上下文风格， 
        ///
        /// \param  pageId RibbonPage的Id, 唯一标识
        /// \param  groups 待添加的Group对象
        /// \param  contextualPageCaption RibbonPage上下文标题
        /// \return bool true-添加成功，false-添加失败
        virtual bool AddGroups(const std::wstring& pageId, std::vector<OwnerPtr<IRibbonGroup>>& groups, const std::wstring& contextualPageCaption) = 0;

        /// 清除所有自定义添加的Group， 并清除Group所在Page的上下文风格
        ///
        /// 这里的自定义指的是通过 AddGroup/AddGroups接口添加的
        ///
        /// \return bool true-添加成功，false-添加失败
        virtual bool DeleteAllGroups() = 0;

        /// 获取当前激活RibbonPage的Id
        /// \return std::wstring 当前激活的RibbonPageId
        virtual std::wstring GetActiveatePageId() = 0;
        
        /// 重新激活上一个被激活的RibbonPage， 并设置为当前页
        /// \return void
        virtual void ActivatePreviousPage() = 0;
    };

}
